/*
 * SalesController.java
 *
 * Created on March 29, 2007, 8:51 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package edu.byu.isys413.mystuff.sales;
import edu.byu.isys413.mystuff.*;
import java.sql.SQLException;
/**
 *
 * @author Gabe
 */
public class SalesController {
    private static SalesController instance = null;
    
    /** Creates a new instance of ConceptualDAO */
    private SalesController() {
    }
    
    public static synchronized SalesController getInstance() {
        if (instance == null) {
            instance = new SalesController();
        }
        return instance;
    }
   
    
    public SaleBO addItem(SaleBO saleBO, String xid, int quantity)throws SQLException, DataException, ConnectionPoolException{
        
        char first = xid.charAt(0);
        if(first == 'P'){
            ForSaleDAO forSaleDAO = ForSaleDAO.getInstance();
            ForSaleBO forSaleBO = (ForSaleBO)forSaleDAO.readBySKU(xid);
            
            saleBO.setProduct(forSaleBO);     
        
        ProductBO forSale = null;
        //if(sku.charAt(0)=='p'){
           
  
         
            
            
        
        
        
      return forSale;  
    }
}
